//将国际时间转为时间轴方法
// type="时分秒" type="年月日" type="年月日时分秒"
const formatTen = (date, type = "年月日",) => {
  let year = date.getFullYear()
  let month = date.getMonth() + 1
  let day = date.getDate()
  let hour = date.getHours()
  let minute = date.getMinutes()
  let second = date.getSeconds()

  console.log(year, month, day, hour, minute, second,)

  if (type == '年月日') return year + "-" + month + "-" + day
  if (type == '时分秒') return hour + ":" + minute + ":" + second
  if (type == '年月日时分秒') return year + "-" + month + "-" + day + "  " + hour + ":" + minute + ":" + second
  // 
}

module.exports = formatTen
